package com.bawei.composeui2207a.day04.mvi.login

import androidx.lifecycle.ViewModel
import com.bawei.composeui2207a.day04.mvi.base.BaseViewModel
import com.bawei.composeui2207a.day04.mvi.base.IUiIntent
import com.bawei.composeui2207a.model.RetrofitManager

/**
 * 作者：赵亮
 * 时间：2024/12/13 17:06
 * 功能：
 */
class LoginViewModel : BaseViewModel() {
    override fun handIntent(it: IUiIntent) {
        when(it) {
            is LoginIntent.Login -> {
                httpRequest(RetrofitManager.apiService.login(it.map))
            }
            is LoginIntent.Register -> {
                httpRequest(RetrofitManager.apiService.register(it.map))
            }
        }
    }
}